package com.xiaoxx.controller.sys;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xiaoxx.common.result.R;
import com.xiaoxx.model.dto.sys.SysLogQuery;
import com.xiaoxx.model.vo.sys.SysLogVo;
import com.xiaoxx.service.SysLogService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * base--sys--操作记录 前端控制器
 * </p>
 *
 * @author HX
 * @since 2023-08-02
 */
@RestController
@RequestMapping("/api/sys/log")
@Api(value = "SysLogController", tags = "日志")
public class SysLogController {


    @Resource
    private SysLogService logService;

    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ApiOperation(value = "查询日志列表")
    @ApiImplicitParams({@ApiImplicitParam(name = "query", value = "查询角色列表", required = true, dataType = "SysLogQuery", paramType = "Body")})
    @ApiResponses(value = {@ApiResponse(response = SysLogVo.class, code = 200, message = "响应成功")})
    public R<IPage<SysLogVo>> list(@RequestBody SysLogQuery query) {
        return R.success(logService.listLog(query));
    }
}

